#!/bin/bash
#instrument apk file in $apkfile and copy them 
#from $ellahome/ella-out to $instrumentedapkfile
apkfile="/home/sheyi/apk/"
ellahome="/home/sheyi/source-code/ella-master";
expdroidhome="/home/sheyi/gitproject/CrawlDroid"
instrumentedapkfile="/home/sheyi/instrumentedApk/"
function instrumentApk(){
     for file in `ls $1`
       do
             echo "$file instrument begin..."
                $ellahome/ella.sh i $1$file
             echo "$file instrument finished"
             
     done
      echo "copy file begin"
    for file in `ls $ellahome/ella-out/`
       do
            if [ -d $ellahome/ella-out/$file ] 
            then 
              cp $ellahome/ella-out/$file/$file $instrumentedapkfile
              cp $ellahome/ella-out/$file/covids $expdroidhome/covids/$file.covids
            fi
    done
       echo "copy file end"
}
instrumentApk $apkfile

